using System;
using System.Reflection;

using VitaReader;
using VitaReaderLibPS;

namespace PSVitaReader
{
	public class AppMain
	{
		private static VitaReader.IReader mReader;
		
		public static void Main (String[] args)
		{
			Initialize();
			Update();
			Shutdown();
		}

		public static void Initialize ()
		{
			IReaderFactory factory = new PSReaderFactory();
			mReader = factory.CreateReader("VitaReaderLibPS.PSReader");
			if( mReader != null )
				mReader.Initialize();
		}

		public static void Update ()
		{
			while (mReader != null && mReader.Continue)
			{
				mReader.Update();
			}
		}

		public static void Shutdown ()
		{
			if( mReader != null )
				mReader.Shutdown();
		}
	}
}
